﻿<UserControl x:Class="Hardanger.View.Partial.ServerFuzzerConfigurationItem"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <UserControl.Resources>
        <BooleanToVisibilityConverter x:Key="b2v" />
    </UserControl.Resources>
    <StackPanel  Name="stackPanel1">	
		<Label Content="{Binding Name}" Height="28" HorizontalAlignment="Left" Name="label9" VerticalAlignment="Top" FontWeight="Bold" />
		<ListView HorizontalAlignment="Stretch"  ItemsSource="{Binding ConfigurationItems}"  SelectionMode="Single">
						<ListView.View>
							<GridView>
                                <GridViewColumn Header="Active" Width="50">
									<GridViewColumn.CellTemplate>
										<DataTemplate>
											<CheckBox IsChecked="{Binding Value.Enabled}"/>
										</DataTemplate>
									</GridViewColumn.CellTemplate>
								</GridViewColumn>
                                <GridViewColumn Width="Auto"  Header="Header Name"  DisplayMemberBinding="{Binding Path=Key}" />
                                <GridViewColumn Header="Fuzz Engine" Width="200" >
									<GridViewColumn.CellTemplate>
										<DataTemplate>
                                <ComboBox Visibility="{Binding Value.Enabled, Converter={StaticResource b2v}}" Width="185" ItemsSource="{Binding Value.AllFuzzers}" SelectedValue="{Binding Value.ServerFuzzingEngineName}" SelectedIndex="0" />
                            </DataTemplate>
									</GridViewColumn.CellTemplate>
								</GridViewColumn>
                                 <GridViewColumn Width="85">
                                    <GridViewColumn.CellTemplate>
                                        <DataTemplate>
                                            <Button Content="Configure" Visibility="{Binding Value.Enabled, Converter={StaticResource b2v}}" Command="{Binding Value.ConfigureCommand}" />
                                        </DataTemplate>
                                    </GridViewColumn.CellTemplate>
                                </GridViewColumn>
                            </GridView>
						</ListView.View>
					</ListView>
	</StackPanel>
</UserControl>
